3.21 \(\int \frac {\csc ^2(x)}{a+b \cos ^2(x)} \, dx\)

Optimal. Leaf size=41 \[ -\frac {\cot (x)}{a+b}-\frac {b \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{3/2}} \]

[Out]

-cot(x)/(a+b)-b*arctan(cot(x)*(a+b)^(1/2)/a^(1/2))/(a+b)^(3/2)/a^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3191, 388, 205} \[ -\frac {\cot (x)}{a+b}-\frac {b \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{3/2}} \]

Antiderivative was successfully verified.

[In]

Int[Csc[x]^2/(a + b*Cos[x]^2),x]

[Out]

-((b*ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]])/(Sqrt[a]*(a + b)^(3/2))) - Cot[x]/(a + b)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 3191

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\csc ^2(x)}{a+b \cos ^2(x)} \, dx &=-\operatorname {Subst}\left (\int \frac {1+x^2}{a+(a+b) x^2} \, dx,x,\cot (x)\right )\\ &=-\frac {\cot (x)}{a+b}-\frac {b \operatorname {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{a+b}\\ &=-\frac {b \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{3/2}}-\frac {\cot (x)}{a+b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 40, normalized size = 0.98 \[ \frac {b \tan ^{-1}\left (\frac {\sqrt {a} \tan (x)}{\sqrt {a+b}}\right )}{\sqrt {a} (a+b)^{3/2}}-\frac {\cot (x)}{a+b} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]^2/(a + b*Cos[x]^2),x]

[Out]

(b*ArcTan[(Sqrt[a]*Tan[x])/Sqrt[a + b]])/(Sqrt[a]*(a + b)^(3/2)) - Cot[x]/(a + b)

________________________________________________________________________________________

fricas [B]  time = 0.67, size = 228, normalized size = 5.56 \[ \left [-\frac {\sqrt {-a^{2} - a b} b \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \relax (x)^{4} - 2 \, {\left (4 \, a^{2} + 3 \, a b\right )} \cos \relax (x)^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \relax (x)^{3} - a \cos \relax (x)\right )} \sqrt {-a^{2} - a b} \sin \relax (x) + a^{2}}{b^{2} \cos \relax (x)^{4} + 2 \, a b \cos \relax (x)^{2} + a^{2}}\right ) \sin \relax (x) + 4 \, {\left (a^{2} + a b\right )} \cos \relax (x)}{4 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \sin \relax (x)}, -\frac {\sqrt {a^{2} + a b} b \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \relax (x)^{2} - a}{2 \, \sqrt {a^{2} + a b} \cos \relax (x) \sin \relax (x)}\right ) \sin \relax (x) + 2 \, {\left (a^{2} + a b\right )} \cos \relax (x)}{2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \sin \relax (x)}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^2/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[-1/4*(sqrt(-a^2 - a*b)*b*log(((8*a^2 + 8*a*b + b^2)*cos(x)^4 - 2*(4*a^2 + 3*a*b)*cos(x)^2 + 4*((2*a + b)*cos(
x)^3 - a*cos(x))*sqrt(-a^2 - a*b)*sin(x) + a^2)/(b^2*cos(x)^4 + 2*a*b*cos(x)^2 + a^2))*sin(x) + 4*(a^2 + a*b)*
cos(x))/((a^3 + 2*a^2*b + a*b^2)*sin(x)), -1/2*(sqrt(a^2 + a*b)*b*arctan(1/2*((2*a + b)*cos(x)^2 - a)/(sqrt(a^
2 + a*b)*cos(x)*sin(x)))*sin(x) + 2*(a^2 + a*b)*cos(x))/((a^3 + 2*a^2*b + a*b^2)*sin(x))]

________________________________________________________________________________________

giac [A]  time = 0.34, size = 55, normalized size = 1.34 \[ \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {a \tan \relax (x)}{\sqrt {a^{2} + a b}}\right )\right )} b}{\sqrt {a^{2} + a b} {\left (a + b\right )}} - \frac {1}{{\left (a + b\right )} \tan \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^2/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

(pi*floor(x/pi + 1/2)*sgn(a) + arctan(a*tan(x)/sqrt(a^2 + a*b)))*b/(sqrt(a^2 + a*b)*(a + b)) - 1/((a + b)*tan(
x))

________________________________________________________________________________________

maple [A]  time = 0.11, size = 39, normalized size = 0.95 \[ \frac {b \arctan \left (\frac {a \tan \relax (x )}{\sqrt {\left (a +b \right ) a}}\right )}{\left (a +b \right ) \sqrt {\left (a +b \right ) a}}-\frac {1}{\left (a +b \right ) \tan \relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)^2/(a+b*cos(x)^2),x)

[Out]

b/(a+b)/((a+b)*a)^(1/2)*arctan(a*tan(x)/((a+b)*a)^(1/2))-1/(a+b)/tan(x)

________________________________________________________________________________________

maxima [A]  time = 0.74, size = 38, normalized size = 0.93 \[ \frac {b \arctan \left (\frac {a \tan \relax (x)}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} {\left (a + b\right )}} - \frac {1}{{\left (a + b\right )} \tan \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^2/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

b*arctan(a*tan(x)/sqrt((a + b)*a))/(sqrt((a + b)*a)*(a + b)) - 1/((a + b)*tan(x))

________________________________________________________________________________________

mupad [B]  time = 2.30, size = 34, normalized size = 0.83 \[ \frac {b\,\mathrm {atan}\left (\frac {\sqrt {a}\,\mathrm {tan}\relax (x)}{\sqrt {a+b}}\right )}{\sqrt {a}\,{\left (a+b\right )}^{3/2}}-\frac {1}{\mathrm {tan}\relax (x)\,\left (a+b\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)^2*(a + b*cos(x)^2)),x)

[Out]

(b*atan((a^(1/2)*tan(x))/(a + b)^(1/2)))/(a^(1/2)*(a + b)^(3/2)) - 1/(tan(x)*(a + b))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc ^{2}{\relax (x )}}{a + b \cos ^{2}{\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)**2/(a+b*cos(x)**2),x)

[Out]

Integral(csc(x)**2/(a + b*cos(x)**2), x)

________________________________________________________________________________________